
#pragma once

#include "stdafx.h"

class IDirect3D9;
class Viewer
{
public:

	Viewer()
		: m_hWnd(0)
		, m_pCanvas(NULL)
		, m_pBlockMap(0)
	{

	}
	~Viewer()
	{
		Clean();
	}

	bool Init ( HWND hWnd );
	void Clean ( );

	void Process ( );

	void Render ( );

	void HandleInput ( );

	inline InputHandler & GetInputHandler ( ) { return m_xInput; }

	static void InputAction_CamMoveForward ( void * pData );
	static void InputAction_CamMoveBack ( void * pData );
	static void InputAction_CamMoveLeft ( void * pData );
	static void InputAction_CamMoveRight ( void * pData );
	static void InputAction_CamMoveUp ( void * pData );
	static void InputAction_CamMoveDown ( void * pData );

	static void InputAction_SplitBlock ( void * pData );

private:
	bool InitCanvas ( );
	bool InitConsole ( );
	bool InitCamera ( );
	bool InitBlox ( );
	bool InitInput ( );

	void CleanConsole ( );
	void CleanCanvas ( );

private:
	HWND m_hWnd;

	InputHandler m_xInput;

	Blox::Canvas * m_pCanvas;

	RenderPacket m_xMain3D;

	Blox::Map * m_pBlockMap;


};




